#ifndef  _PACKET_QUEUE_H_
#define _PACKET_QUEUE_H_

extern "C"
{
#include <libavutil/avutil.h>
#include <libavutil/frame.h>
#include <libavcodec/avcodec.h>
}

#include <mutex>
#include <queue>
#include <atomic>

class PacketQueue
{
public:
    void push(AVPacket* pkt);

	AVPacket* pop();

	int queueSize();

	size_t bytesSize();

    void clear();

	~PacketQueue();

private:
	std::queue<AVPacket*> m_q;
	std::mutex m_mutex;
    size_t m_bytesSize = 0;
};


#endif // ! _PACKET_QUEUE_H_
